<template>
	<div id="app">
		<!--<router-view/>-->
		<keep-alive>
			<router-view></router-view>
		</keep-alive>
	</div>
</template>

<script>
	import { mapGetters, mapMutations } from 'vuex'
	export default {
		name: 'app',
		mounted() {
			var localNav = JSON.parse(sessionStorage.getItem("nav"));
			var localPurl = JSON.parse(sessionStorage.getItem("purl"));
			var localToken=sessionStorage.getItem("token");
			if(localNav == null || localNav == undefined || localNav == '') {
				this.$router.push('/')
				return
			} else {
				if(this.$store.state.nav == "") {
					this.nav(localNav)
				}
				if(this.$store.state.purl == "") {
					this.purl(localPurl)
				}
				if(this.$store.state.token == "") {
					this.token(localToken)
				}
				this.$router.push('/interface/homemain')
			}

		},
		methods: {
			...mapMutations({
				token: 'TOKEN',
				nav: "NAV",
				purl: "PURL"
			})
		}
	}
</script>

<style>
	#app {
		height: 100%;
	}
</style>